From ee52af859ff75ed9391d497fdde37b60978fbca8 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Mon, 24 Oct 2005 09:15:53 -0600 Subject: [PATCH] Necessary change to make ia64 dom0 rework: - All even channels on xen/ia64 shares one common interrupt vector - xen_start_info is initialized only after xen_init, so adjust sequence to avoid access before initialization Signed-off-by Kevin Tian --- .../arch/ia64/xen/drivers/evtchn_ia64.c | 8 ++++++-- linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c | 2 +- .../drivers/xen/xenbus/xenbus_probe.c | 11 ++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c index 0027b82a62..ac8ff9ec4c 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c @@ -29,7 +29,7 @@ unsigned int bind_virq_to_evtchn(int virq) return op.u.bind_virq.port; } -int bind_virq_to_irq(int virq) +int bind_virq_to_irq(int virq, int cpu) { printk("bind_virq_to_irq called... FIXME??\n"); while(1); @@ -66,7 +66,11 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn, evtchns[evtchn].handler = handler; evtchns[evtchn].dev_id = dev_id; unmask_evtchn(evtchn); - return 0; + //return 0; + /* On ia64, there's only one irq vector allocated for all event channels, + * so let's just return evtchn as handle for later communication + */ + return evtchn; } void unbind_evtchn_from_irqhandler(unsigned int evtchn, void *dev_id) diff --git a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c index b13f22a771..db954ca768 100644 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c index e5c9de1139..74d42f6d8d 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c @@ -714,11 +714,7 @@ static int xsd_port_read(char *page, char **start, off_t off, static int __init xenbus_probe_init(void) { - int err = 0; - /* - ** Domain0 doesn't have a store_evtchn or store_mfn yet. - */ - int dom0 = (xen_start_info->store_evtchn == 0); + int err = 0, dom0; printk("xenbus_probe_init\n"); @@ -733,6 +729,11 @@ static int __init xenbus_probe_init(void) device_register(&xenbus_frontend.dev); device_register(&xenbus_backend.dev); + /* + ** Domain0 doesn't have a store_evtchn or store_mfn yet. + */ + dom0 = (xen_start_info->store_evtchn == 0); + if (dom0) { unsigned long page; -- 2.30.2